var util = require('../../utils/util.js');
var common = require('../../utils/common.js');
var PageBase = require('../../common/PageBase.js');
var app = getApp();

Page(common.extendPage(PageBase, {
    data: {
        winHei: 0,
        dataLoaded: false,
        userInfo: {},
        isLoign: false,
        isShopLogin: false
    },

    onLoad: function() {
        this.setData({
            winHei: app.getWinHei()
        })
    },

    onShow() {
        var _self = this;
        app.getUserInfo(function(userInfo) {
            _self.setData({
                isLoign: !!app.getUserSid(),
                isShopLogin: !!app.getEmployeeSid(),
                userInfo: userInfo,
                dataLoaded: true
            });
        })
    }
}));